package com.yanqu.road.server.cmd.unionwar;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.unionwar.UnionWarActivityServerProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.unionwar.CrossUnionWarGuessMgr;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_CROSS_UNION_WAR_SYNC_CONDITION_ACHIEVE, desc = "请求同步竞猜奖励档位达成人数数据")
public class CrossUnionWarSyncConditionAchieveCmd extends CrossUnionCommand {
    private int activityId;
    private int groupId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        UnionWarActivityServerProto.UnionWarConditionAchieveReqMsg msg = UnionWarActivityServerProto.UnionWarConditionAchieveReqMsg.parseFrom(packet.getBytes());
        activityId = msg.getActivityId();
        groupId = msg.getGroupId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossUnionWarGuessMgr.syncOneGameServer(activityId, serverId, groupId);
    }

    @Override
    public void sendData() {

    }
}
